<form id="cart_sub">

    <ul class="cart-pupList">

        <volist name="cartList" id="cartList">

            <li>
                <div class="pic fl">
                    <img src="{$cartList.original_img}">
                </div>
                <div class="word fr">
                 <a href="javascript:;" class="delete" data-id="{$cartList.id}" onclick="del_goods(this)" >删除</a>
                    <h3 class="t">{$cartList.goods_name}</h3>
                    <div class="c">
                        {$cartList.goods_remark}
                    </div>
                    <div class="f clearfix">
                        <span class="price fl">￥<strong>{$cartList.goods_price}</strong></span>

                        <div class="quantity fr clearfix">
                            <a href="javascript:;" class="decrease iconfont" onclick="switch_num(-1,{$cartList.id},true)">&#xe6fd;</a>
                            <input id="in{$cartList.id}" type="tel" class="inpt" size="4" name="num[{$cartList.id}]" value="{$cartList.goods_num}" max="{$cartList.store_count}" readonly>
                            <a href="javascript:;" class="increase iconfont" onclick="switch_num(1,{$cartList.id},true)">&#xe71b;</a>
                        </div>

                    </div>
                </div>
            </li>

        </volist>
    </ul>

</form>

<script>
    $(function () {
        $("#total_price").html("{$total_price.total_fee}");
        $("#total_num").html("{$total_price.num}");
    })
    
    function del_goods(obj){
      layer.confirm('确认删除？', function () {
      	var item_id = $(obj).attr('data-id');
          $.ajax({
              type: 'post',
              url: '/home/cart/del_meal_goods.html',
              data : {item_id:item_id},// 你的formid
              dataType: 'json',
              success: function (data) {
                  if (data.status == 200) {
                  	layer.msg(data.msg,{icon:1,time:2000},function(){
                  		CartList();
                  	});
                      
                  } else {
                      layer.msg(data.msg,{icon:2,time:2000},function(){if(data.url){ window.location.href = data.url;}});
                  }
              }
          })
      });
  }
</script>